home *** CD-ROM | disk | FTP | other *** search
/ Aminet 40 / Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso / Aminet / comm / irc / KuangEleven3Gm.lha / Kuang Eleven 3 / Rexx / awayback.amirx < prev    next >
Text File  |  1998-05-09  |  2KB  |  86 lines

  1. /* $VER: awayback.amirx 3.0 (9.5.98) AwayBack.amirx - Kuang Eleven edition
  2.    Requires : AmIRC 2 , Kuang Eleven 2.9
  3.    Configure the sound to play in the line below
  4.    sets BACK
  5. */
  6. snd='Back.WAV'
  7. options results
  8.  
  9. defaultaway='Making Coffee'
  10. parse arg line
  11. if line='SHOWLOG' then do
  12.     call showlog
  13.     exit
  14. end
  15. clip='st_awayargs'right(address(),1)
  16. args=getclip(clip)
  17. call setclip(clip)
  18. call readargs(args,'QUIET=Q/S,VERBOSE=V/S,ALL/S,SHOW/S,BULLSHIT/F')
  19.  
  20.  
  21. x=getclip('st_awaymsgs')
  22. if x='' then x='no';else call setclip('st_awaymsgs')
  23. cecho('AwayLog','You have' x 'messages waiting')
  24. if x~='no' then call showlog
  25.  
  26. call setclip('st_awayt')
  27.  
  28. str=getclip('st_backstr')
  29. cmd=getclip('st_backcmd')
  30. a=getclip('sc_awaytxt')
  31.  
  32. if show then "SHOW"
  33. clip='st_orignick'right(address(),1)
  34. onick=getclip(clip)
  35. if onick~='' then do
  36.     call setclip(clip)
  37.     'RAW NICK' onick
  38. end
  39. if str~='' then do
  40.     "CHANNELS"
  41.     c=result
  42.     "GETCHANNEL"
  43.     cc=result
  44.     if words(c)~==0 then do i=1 to words(c)
  45.         ic=word(c,i)
  46.         if ic=cc then 'SAY' cmd
  47.         else 'QueueRAW PRIVMSG' ic ':'str
  48.     end
  49.     if a~='TEXT' then "PLAYSOUND" snd
  50. end
  51. EXIT
  52. /* Shared */
  53. cecho:;"ECHO P="d2c(27)"b«"arg(1)"» TEXT="arg(2)'.';return 0
  54. ply:
  55. if getclip('sc_playsounds')~=='ON' then return 0
  56. 'PLAYSOUND _K11'arg(1)'.snd'
  57. return 0
  58.  
  59. showlog:
  60. f='kuang11/AwayLog'
  61. if open(1,f,'r') then do
  62.     pr='AwayLog'
  63.     if command='AWAY' then cecho(pr,'Displaying your saved messages')
  64.     else do
  65.         "GETAWAYSTATE"
  66.         if rc=5 then exit
  67.         cecho(pr,'You have saved messages from last session')
  68.     end
  69.     do until eof(1)
  70.         y=strip(readln(1))
  71.         if y=='' then leave
  72.         parse var y n t e
  73.         select
  74.             when e='PAGE' then cecho(pr,bld(n) 'Paged you at' t)
  75.             when e='DCCCHAT' then cecho(pr,bld(n) 'Wanted to chat with you at' t)
  76.         otherwise
  77.             cecho(pr,bld(n) 'Said At' t ':' e)
  78.         end
  79.     end
  80.     ply('ENDLOG')
  81.     cecho(pr,'End of Log')
  82.     close(1)
  83.     delete(f)
  84. end
  85. return
  86.